﻿@model MvcCmsProjectTracker.ViewModels.BugIndexViewModel
@section HtmlHead{
    <link href="@Url.Content("/areas/mvccmsprojecttracker/content/demo_page.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("/areas/mvccmsprojecttracker/content/demo_table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("/areas/mvccmsprojecttracker/content/demo_table_jui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("/areas/mvccmsprojecttracker/content/start/jquery-ui-1.8.11.custom.css")" rel="stylesheet" type="text/css" />    
}
<div class="contentpage-outerdiv">
    <div id="container">
        <div class="breadcrumb">
            <span><a href="/projecttracker/bug">Main Menu</a></span><span>» </span><span>Search Issues</span>
        </div>
        <div class="MvcCmsDataGrid">
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="issues">
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
</div>
<select class="issueSearchListParams" id="SearchColumns">
    <option value="All">All</option>
    <option value="BugID">BugID</option>
    <option value="Title">Title</option>    
    <option value="Description">Description</option>    
    <option value="ProjectName">Project Name</option>
    <option value="CategoryName">Category Name</option>
    <option value="PriorityName">Priority</option>
    <option value="MileStoneName">Milestone</option>
    <option value="Status">Status</option>
    <option value="CreatorUserName">Creator</option>
    <option value="DateCreated">Created</option>
    <option value="LastUpdate">LastUpdate</option>
</select>
@section ScriptContent{
    <script src="@Url.Content("/areas/mvccmsprojecttracker/scripts/jquery.dataTables.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("/areas/mvccmsprojecttracker/scripts/dataTableExt.oApi.fnSetFilteringPressEnter.js")" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function () {
            $('#issues').dataTable({
                bProcessing: true,
                bServerSide: true,
                iDisplayLength: 10,
                bLengthChange: true,
                aaSorting: [[2, 'desc'], [0, 'asc']],
                aLengthMenu: [10, 20, 40],
                aoColumns: [
                { sName: "BugID", sTitle: "Bug ID" },
                { sName: "ProjectName", sTitle: "Project" },
                { sName: "CategoryName", sTitle: "Category" },
                { sName: "PriorityName", sTitle: "Priority" },
                { sName: "MileStoneName", sTitle: "Milestone" },
                { sName: "Title", sTitle: "Title" },
                { sName: "Status", sTitle: "Status" },
                { sName: "CreatorUserName", sTitle: "Creator" },
                { sName: "Assigned", sTitle: "Assigned" },
                { sName: "DateCreated", sTitle: "Created" },
                { sName: "LastUpdate", sTitle: "LastUpdate" }
            ],
                bJQueryUI: true,
                sPaginationType: "full_numbers",
                sAjaxSource: "/projecttracker/bug/listissues",
                fnInitComplete: function () {
                    var searchFilter = $("#SearchColumns");
                    $("#issues_filter").append(searchFilter);
                },
                fnServerData: function (sSource, aoData, fnCallback) {
                    aoData.push({ name: "sSingleSearchField", value: $("#SearchColumns").val() });
                    $.ajax({
                        "dataType": 'json',
                        "type": "POST",
                        "url": sSource,
                        "data": aoData,
                        "success": fnCallback
                    })
                }
            }).fnSetFilteringPressEnter();
        });
</script>
}

